package com.woniu.config;


import com.woniu.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
public class LoginInterceptorConfig implements WebMvcConfigurer {

    // 重写一个方法
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 1/把你的拦截器给我注册进来 ,
        // 2/拦截那些请求 所有
        // 3/放行了
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login"
                        ,"/static/**"
                        ,"/login.html"
                        ,"/css/**"
                        ,"/js/**"
                        ,"/images/**","/swagger-ui.html","/webjars/**");
    }
}
